package com.lvcoding.sec3.secdemo3.validatecode.sms;

import com.lvcoding.sec3.secdemo3.validatecode.parent.SmsCodeSender;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 默认的短信配置
 */
@Configuration
public class SmsCodeConfig {

    /**
     * 默认的短信发送服务
     * @return
     */
    @Bean
    @ConditionalOnMissingBean(SmsCodeSender.class)
    public SmsCodeSender smsCodeSender() {
        return new DefaultSmsCodeSender();
    }
}
